<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.thymeleaf.org/thymeleaf-extras-shiro">
<head>
    <meta charset="UTF-8">
    <title>课程信息列表</title>
    <link rel="icon" th:href="@{/favicon.ico}">
    <link rel="shortcut icon" th:href="@{/favicon.ico}">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <link type="text/css"  th:href="@{/css/index.css}" rel="stylesheet"  />
    <link type="text/css"  th:href="@{/css/jconfirm.css}" rel="stylesheet"  />
    <script th:src="@{/js/jQuery1.7.2.js}" type="text/javascript"></script>
    <script th:src="@{/js/index.js}" type="text/javascript"></script>
    <script th:src="@{/js/jconfirm.js}" type="text/javascript"></script>
</head>
<body>
    <div class="mian_center">
        <span class="main_titile"><img th:src="@{/images/login_j_03.png}">课程信息查询</span>

        <div class="main_con">
            <form id="searchFr" th:action="@{/course/list}" method="get">
                <ul>
                    <li><span>课程名称:</span><input name="courseName" type="text" th:value="*{param.courseName}" placeholder="请输入课程名称" autocomplete="off" /></li>
                    <li><span>授课教师:</span><input name="teacherName" type="text" th:value="*{param.teacherName}" placeholder="请输入授课教师" autocomplete="off" /></li>
                    <li shiro:hasPermission="user:list"><span>状态:</span>
                        <select name="flag">
                            <option value="">【请选择】</option>
                            <option th:selected="*{param!=null && #strings.equals(param.flag,'1')}"
                                    th:value="1">已删除</option>
                            <option th:selected="*{param!=null && #strings.equals(param.flag,'0')}"
                                    th:value="0">未删除</option>
                        </select>
                    </li>
                    <li><span class="msg">[[${msg}]]</span></li>
                </ul>
                <span class="main_button">
                    <input type="hidden" name="courseTypeId" th:value="*{param.courseTypeId}" />
                    <input  id="pSize"  name="pSize" type="hidden" th:value="*{param.pSize}" />
                    <input  id="currentPn"  name="pn" type="hidden" th:value="*{param.pn}" />
                    <input type="submit" value="查询" />
                </span>
            </form>

            <table>
                <tr>
                    <th width="30"><input type="checkbox" id="selectAll"></th>
                    <th width="50">序号</th>
                    <th>课程名称</th>
                    <th>所属专业</th>
                    <th>专业课时</th>
                    <th>教室</th>
                    <th>专业收费</th>
                    <th>授课老师</th>
                    <th>报名条件</th>
                    <th shiro:hasPermission="user:list">创建时间</th>
                    <th shiro:hasPermission="user:list">修改时间</th>
                    <th>操作</th>
                </tr>

                <tr th:each="course : ${courses}">
                    <td><input type="checkbox" class="selectItem" th:value="${course.courseId}"></td>
                    <td>[[${course.courseId }]]</td>
                    <td>[[${course.courseName }]]</td>
                    <td>[[${course.courseTypeName }]]</td>
                    <td>[[${course.courseDuration }]]</td>
                    <td>[[${course.classroomName }]]</td>
                    <td>[[${course.coursePrice }]]/专业课时费</td>
                    <td>[[${course.teacherName }]]</td>
                    <td th:unless="${course.minAge!=course.maxAge}">[[${course.maxAge }]]周岁</td>
                    <td th:if="${course.minAge!=course.maxAge}">[[${course.minAge }]]-[[${course.maxAge }]]周岁</td>
                    <td shiro:hasPermission="user:list">[[${couese.createTime==null?'--':#dates.format(course.createTime,'YYYY/MM/dd HH:mm:ss')}]]</td>
                    <td shiro:hasPermission="user:list">[[${course.updateTime==null?'--':#dates.format(course.updateTime,'YYYY/MM/dd HH:mm:ss')}]]</td>
                    <td>
                        <a shiro:hasPermissions="[course:list,course:add]" class="btn mr5" th:href="@{/course/edit(courseId=${course.courseId })}" title="修改">修改</a>
                        <a shiro:hasPermissions="[course:list,course:add]" th:if="${#strings.equals(course.flag,'0')}" class="btn" th:href="${'javascript: remove('+course.courseId+');'}" title="删除">删除</a>
                        <a shiro:hasPermission="user:list" th:if="${#strings.equals(course.flag,'1')}" class="btn" th:href="${'javascript: remove('+course.courseId+');'}" title="删除">删除</a>
                    </td>
                </tr>
                <tr th:if="${#lists.isEmpty(courses)}">
                    <td colspan="12">暂无任何记录</td>
                </tr>
            </table>
        </div>

        <div class="main_page_number" th:unless="${#lists.isEmpty(courses)}" th:include="/common/page :: page">
        </div>
    </div>
</body>
</html>